require("../../assets/css/common.css");
require("../we/we.css");
require("../../assets/fonts/iconfont.css");

const dom = require("../../utils/dom.js");
const axios = require("axios");
window.addEventListener("load", function () {
	// 渲染tabbar
	dom.renderFtr("we");
	//发送请求
	axios.defaults.baseURL = " http://fitness.h5.itsource.cn:3701";
	let token = localStorage.getItem("token");
	axios.defaults.headers.common["Authorization"] = "Bearer " + token;
	axios.get("/api/user/info").then((res) => {
		//获取用户名
		let data = res.data.data;
		dom.get(".nickname").textContent = data.nickName;
		// 获取个性签名
		dom.get(".sign").textContent = `个性签名：` + data.sign;
		// 获取运动消耗时长
		dom.get(".duration").innerHTML = data.duration + `<span>分钟</span`;
		// 获取本周消耗千卡
		dom.get(".calorie").innerHTML = data.calorie + `<span>千卡</span`;
	});
	// 获取运动徽章
});
